#!/bin/sh
#rxvt does not understand the '-hold' option.
#urxvt 20120214

case "$*" in *"-hold "*)
 EXECCOMMAND="`echo -n ${*} | grep -o ' \-e .*' | sed -e 's/ \-e //'`"
 if [ "$EXECCOMMAND" != "" ];then
   (
    echo '#!/bin/sh'
    echo "$EXECCOMMAND"
    echo 'echo'
    echo 'echo -n "FINISHED. PRESS ENTER KEY TO CLOSE THIS WINDOW: "'
    echo 'read simuldone'
   ) > /tmp/xterm_simulate_hold.sh
   exec urxvt -title xterm -e sh /tmp/xterm_simulate_hold.sh
 fi
 ;;
esac

exec urxvt "${@}"

### END ###
